package com.cms.recursoshumanos.handler;

import com.cms.recursoshumanos.cache.UserInfoCache;
import com.cms.recursoshumanos.facade.DetailPolizaScreenFacade;
import com.cms.recursoshumanos.facade.ListaHospitalFamiliarScreenFacade;
import com.cms.recursoshumanos.facade.PlanillaCartaAvalScreenFacade;
import com.cms.recursoshumanos.object.Familiar;
import com.cms.recursoshumanos.object.Hospital;
import com.cms.recursoshumanos.object.Poliza;

public class DetailPolizaScreenHandler extends BaseHandler

{
	

	public void getDetailSeguro (String username, String password)
	{
		if ( (!(UserInfoCache.getInstance().cache_utilizable(4))))
		{
			DetailPolizaScreenFacade lista_poliza_facade = new DetailPolizaScreenFacade(username,password,false);
		
			lista_poliza_facade.getDetailPoliza();
		}
		else
		{
			this.goPoliza();
		}
			
	}
	
	public void getPlanillaCartaAval(String username, String password, Poliza laPoliza, 
										String nombre_operation, String monto, Hospital elHospital, 
										Familiar elFamiliar)
	{
		
		PlanillaCartaAvalScreenFacade facade = new PlanillaCartaAvalScreenFacade(username,
																					password,
																					laPoliza.getIdPoliza(),
																					elFamiliar.getIdFamiliar(),
																					elHospital.getIdHospital(),
																					nombre_operation,monto);
		facade.getPlanillaCartaAval();
	}
	
	public void getListaHospitalBeneficiarios(String username, String password, Poliza laPoliza)
	{
		if (!((UserInfoCache.getInstance().cache_utilizable(2)) && 
				(UserInfoCache.getInstance().cache_utilizable(7)) ))
		
		{
			ListaHospitalFamiliarScreenFacade facade = new ListaHospitalFamiliarScreenFacade(username, 
																								password, 
																								laPoliza);
			facade.getListaHospital();
		}
		else
		{
			this.goPantallaCartaAval(laPoliza);
		}
	}
	
	
}

